package org.springmole.business.bean.hibernate;

import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlTransient;


@XmlAccessorType(XmlAccessType.FIELD)
public class SummaryData extends HibernateData {

	@XmlElement(name="Item")
	@XmlElementWrapper(name="GeneralSummary")
	private List<SummaryItemData> generalItemDataList = new ArrayList<SummaryItemData>();		
	
	@XmlTransient
	private long optimisticFailureCount;

	@XmlTransient
	private long prepareStatementCount;
	
	@XmlTransient
	private long closeStatementCount;
	
	@XmlTransient
	private long connectCount;
	
	@XmlTransient
	private long sessionOpenCount;
	
	@XmlTransient
	private long sessionCloseCount;
	
	@XmlTransient
	private long successfulTransactionCount;

	@XmlTransient
	private long transactionCount;
	
	
	@XmlElement(name="Item")
	@XmlElementWrapper(name="CollectionSummary")
	private List<SummaryItemData> collectionItemDataList = new ArrayList<SummaryItemData>();
	
	@XmlTransient
	private long collectionFetchCount;

	@XmlTransient
	private long collectionLoadCount;

	@XmlTransient
	private long collectionRecreateCount;

	@XmlTransient
	private long collectionRemoveCount;

	@XmlTransient
	private long collectionUpdateCount;

	
	@XmlElement(name="Item")
	@XmlElementWrapper(name="EntitySummary")
	private List<SummaryItemData> entityItemDataList = new ArrayList<SummaryItemData>();
	
	@XmlTransient
	private long entityDeleteCount;

	@XmlTransient
	private long entityFetchCount;

	@XmlTransient
	private long entityInsertCount;

	@XmlTransient
	private long entityLoadCount;

	@XmlTransient
	private long entityUpdateCount;
	

	@XmlElement(name="Item")
	@XmlElementWrapper(name="QuerySummary")
	private List<SummaryItemData> queryItemDataList = new ArrayList<SummaryItemData>();
	
	@XmlTransient
	private long queryCacheHitCount;

	@XmlTransient
	private long queryCacheMissCount;

	@XmlTransient
	private long queryCachePutCount;

	@XmlTransient
	private long queryExecutionCount;

	@XmlTransient
	private long queryExecutionMaxTime;

	@XmlTransient
	private String queryExecutionMaxTimeQueryString;
	
	
	@XmlElement(name="Item")
	@XmlElementWrapper(name="SecondLevelSummary")
	private List<SummaryItemData> secondLevelItemDataList = new ArrayList<SummaryItemData>();	
	
	@XmlTransient
	private long secondLevelCacheHitCount;

	@XmlTransient
	private long secondLevelCacheMissCount;

	@XmlTransient
	private long secondLevelCachePutCount;

	
	
	
	public void init() {
		
		collectionItemDataList.add(new SummaryItemData("fetch", collectionFetchCount));
		collectionItemDataList.add(new SummaryItemData("load", collectionLoadCount));
		collectionItemDataList.add(new SummaryItemData("recreate", collectionRecreateCount));
		collectionItemDataList.add(new SummaryItemData("remove", collectionRemoveCount));
		collectionItemDataList.add(new SummaryItemData("update", collectionUpdateCount));

		entityItemDataList.add(new SummaryItemData("fetch", entityFetchCount));
		entityItemDataList.add(new SummaryItemData("load", entityLoadCount));
		entityItemDataList.add(new SummaryItemData("delete", entityDeleteCount));
		entityItemDataList.add(new SummaryItemData("insert", entityInsertCount));
		entityItemDataList.add(new SummaryItemData("update", entityUpdateCount));
				
		queryItemDataList.add(new SummaryItemData("cacheHitCount", queryCacheHitCount));
		queryItemDataList.add(new SummaryItemData("cacheMissCount", queryCacheMissCount));
		queryItemDataList.add(new SummaryItemData("cachePutCount", queryCachePutCount));
		queryItemDataList.add(new SummaryItemData("executionCount", queryExecutionCount));
		queryItemDataList.add(new SummaryItemData("executionMaxTime", queryExecutionMaxTime));
		queryItemDataList.add(new SummaryItemData("executionMaxTimeQuery", queryExecutionMaxTimeQueryString));
		
		secondLevelItemDataList.add(new SummaryItemData("hitCount", secondLevelCacheHitCount));
		secondLevelItemDataList.add(new SummaryItemData("missCount", secondLevelCacheMissCount));
		secondLevelItemDataList.add(new SummaryItemData("putCount", secondLevelCachePutCount));

		generalItemDataList.add(new SummaryItemData("optimisticFailureCount", optimisticFailureCount));
		generalItemDataList.add(new SummaryItemData("prepareStatementCount", prepareStatementCount));
		generalItemDataList.add(new SummaryItemData("closeStatementCount", closeStatementCount));
		generalItemDataList.add(new SummaryItemData("connectCount", connectCount));
		generalItemDataList.add(new SummaryItemData("sessionOpenCount", sessionOpenCount));
		generalItemDataList.add(new SummaryItemData("sessionCloseCount", sessionCloseCount));
		generalItemDataList.add(new SummaryItemData("successfulTransactionCount", successfulTransactionCount));
		generalItemDataList.add(new SummaryItemData("transactionCount", transactionCount));

	}	
	
	
	public List<SummaryItemData> getCollectionItemDataList() {
		return collectionItemDataList;
	}
	
	public void setCollectionItemDataList(List<SummaryItemData> collectionItemDataList) {
		this.collectionItemDataList = collectionItemDataList;
	}
	
	public long getCollectionFetchCount() {
		return collectionFetchCount;
	}

	public void setCollectionFetchCount(long collectionFetchCount) {
		this.collectionFetchCount = collectionFetchCount;
	}

	public long getCollectionLoadCount() {
		return collectionLoadCount;
	}

	public void setCollectionLoadCount(long collectionLoadCount) {
		this.collectionLoadCount = collectionLoadCount;
	}

	public long getCollectionRecreateCount() {
		return collectionRecreateCount;
	}

	public void setCollectionRecreateCount(long collectionRecreateCount) {
		this.collectionRecreateCount = collectionRecreateCount;
	}

	public long getCollectionRemoveCount() {
		return collectionRemoveCount;
	}

	public void setCollectionRemoveCount(long collectionRemoveCount) {
		this.collectionRemoveCount = collectionRemoveCount;
	}

	public long getCollectionUpdateCount() {
		return collectionUpdateCount;
	}

	public void setCollectionUpdateCount(long collectionUpdateCount) {
		this.collectionUpdateCount = collectionUpdateCount;
	}
	
	public List<SummaryItemData> getEntityItemDataList() {
		return entityItemDataList;
	}	
	
	public void setEntityItemDataList(List<SummaryItemData> entityItemDataList) {
		this.entityItemDataList = entityItemDataList;
	}
	
	public long getEntityDeleteCount() {
		return entityDeleteCount;
	}

	public void setEntityDeleteCount(long entityDeleteCount) {
		this.entityDeleteCount = entityDeleteCount;
	}

	public long getEntityFetchCount() {
		return entityFetchCount;
	}

	public void setEntityFetchCount(long entityFetchCount) {
		this.entityFetchCount = entityFetchCount;
	}

	public long getEntityInsertCount() {
		return entityInsertCount;
	}

	public void setEntityInsertCount(long entityInsertCount) {
		this.entityInsertCount = entityInsertCount;
	}

	public long getEntityLoadCount() {
		return entityLoadCount;
	}

	public void setEntityLoadCount(long entityLoadCount) {
		this.entityLoadCount = entityLoadCount;
	}

	public long getEntityUpdateCount() {
		return entityUpdateCount;
	}

	public void setEntityUpdateCount(long entityUpdateCount) {
		this.entityUpdateCount = entityUpdateCount;
	}

	
	
	
	public long getQueryCacheHitCount() {
		return queryCacheHitCount;
	}

	public void setQueryCacheHitCount(long queryCacheHitCount) {
		this.queryCacheHitCount = queryCacheHitCount;
	}

	public long getQueryCacheMissCount() {
		return queryCacheMissCount;
	}

	public void setQueryCacheMissCount(long queryCacheMissCount) {
		this.queryCacheMissCount = queryCacheMissCount;
	}

	public long getQueryCachePutCount() {
		return queryCachePutCount;
	}

	public void setQueryCachePutCount(long queryCachePutCount) {
		this.queryCachePutCount = queryCachePutCount;
	}

	public long getQueryExecutionCount() {
		return queryExecutionCount;
	}

	public void setQueryExecutionCount(long queryExecutionCount) {
		this.queryExecutionCount = queryExecutionCount;
	}

	public long getQueryExecutionMaxTime() {
		return queryExecutionMaxTime;
	}

	public void setQueryExecutionMaxTime(long queryExecutionMaxTime) {
		this.queryExecutionMaxTime = queryExecutionMaxTime;
	}

	public String getQueryExecutionMaxTimeQueryString() {
		return queryExecutionMaxTimeQueryString;
	}

	public void setQueryExecutionMaxTimeQueryString(String queryExecutionMaxTimeQueryString) {
		this.queryExecutionMaxTimeQueryString = queryExecutionMaxTimeQueryString;
	}

	public long getSecondLevelCacheHitCount() {
		return secondLevelCacheHitCount;
	}

	public void setSecondLevelCacheHitCount(long secondLevelCacheHitCount) {
		this.secondLevelCacheHitCount = secondLevelCacheHitCount;
	}

	public long getSecondLevelCacheMissCount() {
		return secondLevelCacheMissCount;
	}

	public void setSecondLevelCacheMissCount(long secondLevelCacheMissCount) {
		this.secondLevelCacheMissCount = secondLevelCacheMissCount;
	}

	public long getSecondLevelCachePutCount() {
		return secondLevelCachePutCount;
	}

	public void setSecondLevelCachePutCount(long secondLevelCachePutCount) {
		this.secondLevelCachePutCount = secondLevelCachePutCount;
	}

	
	
	public long getOptimisticFailureCount() {
		return optimisticFailureCount;
	}

	public void setOptimisticFailureCount(long optimisticFailureCount) {
		this.optimisticFailureCount = optimisticFailureCount;
	}

	public long getPrepareStatementCount() {
		return prepareStatementCount;
	}

	public void setPrepareStatementCount(long prepareStatementCount) {
		this.prepareStatementCount = prepareStatementCount;
	}

	public long getCloseStatementCount() {
		return closeStatementCount;
	}

	public void setCloseStatementCount(long closeStatementCount) {
		this.closeStatementCount = closeStatementCount;
	}

	public long getConnectCount() {
		return connectCount;
	}

	public void setConnectCount(long connectCount) {
		this.connectCount = connectCount;
	}

	public long getSessionOpenCount() {
		return sessionOpenCount;
	}

	public void setSessionOpenCount(long sessionOpenCount) {
		this.sessionOpenCount = sessionOpenCount;
	}

	public long getSessionCloseCount() {
		return sessionCloseCount;
	}

	public void setSessionCloseCount(long sessionCloseCount) {
		this.sessionCloseCount = sessionCloseCount;
	}

	public long getSuccessfulTransactionCount() {
		return successfulTransactionCount;
	}

	public void setSuccessfulTransactionCount(long successfulTransactionCount) {
		this.successfulTransactionCount = successfulTransactionCount;
	}

	public long getTransactionCount() {
		return transactionCount;
	}

	public void setTransactionCount(long transactionCount) {
		this.transactionCount = transactionCount;
	}
	
}
